From 6c5e7d69b6214409104a6612fd0f37345e3461e7 Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Tue, 24 Aug 2010 18:18:20 +0100 Subject: [PATCH] xl: fix strtok() call in vif2 parsing Fix fixes a hang when parsing the vif2 parameter. According to the manpage subsequent calls to strtok() must use NULL in the string parameter to keep the iteration going. Signed-off-by: Andre Przywara Signed-off-by: Ian Jackson --- tools/libxl/xl_cmdimpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index c837e549b6..64f7087c20 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -883,7 +883,7 @@ skip: init_net2_info(net2, d_config->num_vif2s); - for (p = strtok(buf2, ","); p; p = strtok(buf2, ",")) { + for (p = strtok(buf2, ","); p; p = strtok(NULL, ",")) { while (isblank(*p)) p++; if (!strncmp("front_mac=", p, 10)) { -- 2.30.2